<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class configuracion_menus extends CI_Controller {

    public function index() {
        $this->load->view('configuracion/menus');
    }

    public function grilla() {
        $this->load->model('Menu_Model', '', TRUE);
        $arr_menus = $this->Menu_Model->getMenus();

        $response = array();
        $i = 0;
        foreach ($arr_menus as $menu) {
            $response['rows'][$i]['id'] = $menu->men_id; //id
            $response['rows'][$i]['cell'] = array(
                $menu->men_nombre_largo,
                $menu->men_nombre_corto
            );
            $i++;
        }

        echo json_encode($response);
        exit(0);

        return;
    }

}
